define(function (require, exports, module) {
	// require('jquery-easyui-zh');
	// require('jquery-easyui');

	var angular = require('angular');
	require('angular-route');
    require('angular-ui-router');
    var asyncLoader = require('angular-async-loader');

	require('easyui');
	require('form');
	require('security');
 	require('gis');
	require('arcgis3');

    var app = angular.module('app', ['ui.router','ui.easyui','form','security','gis','gis.arcgis'])
    .factory('$app', function($rootScope, $http) {
		$app = {
			// 打开地图查询面板
			attrOpen : false,
			setAttrOpen : function(isOpen){
				if(isOpen==null){
					this.attrOpen = !this.attrOpen;
				}else{
					this.attrOpen = isOpen;
				}
			},
			// 打开查询结果面板
			searchOpen:true,
			setSearchOpen : function(isOpen){
				if(isOpen==null){
					this.searchOpen = !this.searchOpen;
				}else{
					this.searchOpen = isOpen;
				}
			},

			// mis 下zs-content设置高度
			setConHei:function(){
				var hei = $("#zs-main").height() - $("#zs-mis .zs-map-tool").outerHeight();
				$("#zs-mis .zs-content").height(hei);
			}
		};
		for(f in $app){
			$rootScope[f] = $app[f];
		}
		return $app;
	})
	.controller('appCtrl', ['$rootScope', '$scope', '$app',
		function($rootScope, $scope, $app){
			
		}
	]);

    asyncLoader.configure(app);
    module.exports = app;
});